package com.qujia.station.service.impl;

import com.qujia.station.domain.ClassSettlementCard;
import com.qujia.station.mapper.ClassSettlementCardMapper;
import com.qujia.station.service.ClassSettlementCardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 电子卡班结Service业务层处理
 * 
 * @author qujia
 * @date 2022-04-19
 */
@Service
public class ClassSettlementCardServiceImpl implements ClassSettlementCardService
{
    @Autowired
    private ClassSettlementCardMapper classSettlementCardMapper;

    /**
     * 查询电子卡班结
     * 
     * @param id 电子卡班结ID
     * @return 电子卡班结
     */
    @Override
    public ClassSettlementCard selectClassSettlementCardById(Long id)
    {
        return classSettlementCardMapper.selectClassSettlementCardById(id);
    }

    @Override
    public List<ClassSettlementCard> queryGroupByRechargeCardType(ClassSettlementCard classSettlementCard){
        return classSettlementCardMapper.queryGroupByRechargeCardType(classSettlementCard);
    }

    @Override
    public List<ClassSettlementCard> queryGroupByRechargeCardTypeForOrder(ClassSettlementCard classSettlementCard){
        return classSettlementCardMapper.queryGroupByRechargeCardTypeForOrder(classSettlementCard);
    }
    /**
     * 查询电子卡班结列表
     * 
     * @param classSettlementCard 电子卡班结
     * @return 电子卡班结
     */
    @Override
    public List<ClassSettlementCard> selectClassSettlementCardList(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.selectClassSettlementCardList(classSettlementCard);
    }
    @Override
    public List<ClassSettlementCard> selectClassReportCardList(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.selectClassReportCardList(classSettlementCard);
    }
    @Override
    public List<ClassSettlementCard> queryGroupByPayTypeForOrder(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.queryGroupByPayTypeForOrder(classSettlementCard);
    }
    @Override
    public List<ClassSettlementCard> queryGroupByPayType(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.queryGroupByPayType(classSettlementCard);
    }
    @Override
    public List<ClassSettlementCard> queryGroupByCardType(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.queryGroupByCardType(classSettlementCard);
    }
    @Override
    public List<ClassSettlementCard> queryGroupByCardTypeForOrder(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.queryGroupByCardTypeForOrder(classSettlementCard);
    }

    /**
     * 新增电子卡班结
     * 
     * @param classSettlementCard 电子卡班结
     * @return 结果
     */
    @Override
    public int insertClassSettlementCard(ClassSettlementCard classSettlementCard)
    {
        classSettlementCard.setCreateTime(new Date());
        return classSettlementCardMapper.insertClassSettlementCard(classSettlementCard);
    }

    /**
     * 新增电子卡日报表
     *
     * @param classSettlementCard 电子卡班结
     * @return 结果
     */
    @Override
    public int insertClassReportCard(ClassSettlementCard classSettlementCard)
    {
        classSettlementCard.setCreateTime(new Date());
        return classSettlementCardMapper.insertClassReportCard(classSettlementCard);
    }


    /**
     * 修改电子卡班结
     * 
     * @param classSettlementCard 电子卡班结
     * @return 结果
     */
    @Override
    public int updateClassSettlementCard(ClassSettlementCard classSettlementCard)
    {
        return classSettlementCardMapper.updateClassSettlementCard(classSettlementCard);
    }

    /**
     * 批量删除电子卡班结
     * 
     * @param ids 需要删除的电子卡班结ID
     * @return 结果
     */
    @Override
    public int deleteClassSettlementCardByIds(Long[] ids)
    {
        return classSettlementCardMapper.deleteClassSettlementCardByIds(ids);
    }

    /**
     * 删除电子卡班结信息
     * 
     * @param id 电子卡班结ID
     * @return 结果
     */
    @Override
    public int deleteClassSettlementCardById(Long id)
    {
        return classSettlementCardMapper.deleteClassSettlementCardById(id);
    }

    /**
     * 查询未班结信息
     *
     * @param params
     * @return 结果
     */
    @Override
    public List<ClassSettlementCard> queryUntreatedData(Map<String,Object> params)
    {
        return classSettlementCardMapper.queryUntreatedData(params);
    }
    @Override
    public List<ClassSettlementCard> queryUntreatedDataSum(Map<String,Object> params)
    {
        return classSettlementCardMapper.queryUntreatedDataSum(params);
    }

    @Override
    public ClassSettlementCard querySumCz(Map<String, Object> params){
        return classSettlementCardMapper.querySumCz(params);
    }

    @Override
    public List<ClassSettlementCard> sumDzkRechargeRefund(Long stationId, Date startTime, Date endTime) {
        return classSettlementCardMapper.sumDzkRechargeRefund(stationId,startTime,endTime);
    }

}
